import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/allocation',
    name: 'allocation',
    meta,
    redirect: { name: 'allocation' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'allocationList',
            name: `${pre}allocationList`,
            component: _import('allocation/allocationList'),
            meta: {
                ...meta,
                title: '调拨列表'
            }
        },
        {
            path: 'addAllocationOrder',
            name: `${pre}addAllocationOrder`,
            component: _import('allocation/addAllocationOrder'),
            meta: {
                ...meta,
                title: '新建调拨单'
            }
        },
        {
            path: 'allocationOrderDetail',
            name: `${pre}allocationOrderDetail`,
            component: _import('allocation/allocationOrderDetail'),
            meta: {
                ...meta,
                title: '调拨单详情'
            }
        },
        {
            path: 'updateAllocationOrder',
            name: `${pre}updateAllocationOrder`,
            component: _import('allocation/updateAllocationOrder'),
            meta: {
                ...meta,
                title: '编辑调拨单'
            }
        },
        {
            path: 'allocationDetailList',
            name: `${pre}allocationDetailList`,
            component: _import('allocation/allocationDetailList'),
            meta: {
                ...meta,
                title: '调拨明细'
            }
        }
    ])('allocation-')
}
